home *** CD-ROM | disk | FTP | other *** search
- *** ../step06/supfilesrv.c Fri Dec 17 12:49:41 1993
- --- supfilesrv.c Fri Dec 17 16:41:08 1993
- ***************
- *** 233,238 ****
- --- 233,241 ----
- #include <sys/stat.h>
- #include <sys/file.h>
- #include <sys/dir.h>
- + #ifdef _ABI_SOURCE
- + #include <sys/sysmacros.h>
- + #endif
- #if MACH
- #include <sys/ioctl.h>
- #endif
- ***************
- *** 441,452 ****
-
- chldsig()
- {
- union wait w;
-
- ! /* XXX all the signal stuff needs attention */
- while (wait3(&w, WNOHANG, (struct rusage *)0) > 0) {
- if (nchildren) nchildren--;
- }
- }
-
- /*****************************************
- --- 444,464 ----
-
- chldsig()
- {
- + #ifdef _ABI_SOURCE
- + int w;
- + #else
- union wait w;
- + #endif
-
- ! #ifdef _ABI_SOURCE
- ! while (waitpid((pid_t)-1, &w, WNOHANG) > 0) {
- ! if (nchildren) nchildren--;
- ! }
- ! #else
- while (wait3(&w, WNOHANG, (struct rusage *)0) > 0) {
- if (nchildren) nchildren--;
- }
- + #endif
- }
-
- /*****************************************
- ***************
- *** 722,727 ****
- --- 734,742 ----
- register FILE *f;
- struct stat sbuf;
- register TREELIST *tl;
- + #ifdef _ABI_SOURCE
- + struct flock lock;
- + #endif
-
- if (protver > 7) {
- cancompress = TRUE;
- ***************
- *** 911,916 ****
- --- 926,948 ----
- (void) sprintf (buf,FILELOCK,collname);
- x = open (buf,O_RDONLY,0);
- if (x >= 0) {
- + #ifdef _ABI_SOURCE
- + /* lock setup: read lock for whole file */
- + lock.l_type = F_RDLCK;
- + lock.l_start = 0;
- + lock.l_whence = 0;
- + lock.l_len = 0;
- + if (fcntl (x, F_SETLK, &lock) < 0) {
- + (void) close (x);
- + if (errno != EACCES)
- + goaway ("Can't lock collection %s",collname);
- + setupack = FSETUPBUSY;
- + (void) msgsetupack ();
- + if (protver >= 6) longjmp (sjbuf,TRUE);
- + goaway ("Sup client told to wait for lock");
- + }
- + lockfd = x;
- + #else
- if (flock (x,(LOCK_SH|LOCK_NB)) < 0) {
- (void) close (x);
- if (errno != EWOULDBLOCK)
- ***************
- *** 921,926 ****
- --- 953,959 ----
- goaway ("Sup client told to wait for lock");
- }
- lockfd = x;
- + #endif
- }
- setupack = FSETUPOK;
- x = msgsetupack ();
-